<%if @sales.size>0%>
<table width="100%" style="border: 3px solid black; font-size: 30px;">
  <tr align="center" style="border: 3px solid black;" bgcolor="#cccccc">
    <th>Player</th><th>Price</th><th></th><th>Units Sold</th>
    <%@sales.each do |s|%>
      <%p = s.player%>
      <tr align="center">
        <td align="left"><%=p.name%></td>
        <%
          price_added = 0
          game_setting = @game.game_setting
          if p.level==1
            price_added = game_setting.level1_price_added
          end
          if p.level==2
            price_added = game_setting.level2_price_added
          end
          if p.level==3
            price_added = game_setting.level3_price_added
          end
          if p.level==4
            price_added = game_setting.level4_price_added
          end
        %>
        <td><%=s.price%><%if price_added>0%>(+<%=price_added%>)<%end%></td>
        <td>
          <input type="button" value="Roll" onclick="<%=remote_function(:url=>{:controller=>"game_runnings", :action=>"allow_roll", :id=>s.id})%>; PopupCenter('/game_runnings/roll/<%=s.id%>','myPop',900,550);"/>
          <input type="button" value="Clear" onclick="<%=remote_function(:url=>{:controller=>"game_runnings", :action=>"clear_sale", :id=>s.id}, :complete=>"refresh_remain()")%>"/>
        </td>
        <td align="right"><%=number_with_delimiter(s.quantity)%></td>
      </tr>
    <%end%>
  </tr>
</table>
<%end%>